package com.example.baseapp.adpter

import androidx.annotation.LayoutRes
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.baseapp.R

class ImageAdapter(
    @LayoutRes layoutRes: Int = R.layout.image_item,
    data: MutableList<Pair<String, String>>
) :
    BaseQuickAdapter<Pair<String, String>, BaseViewHolder>(layoutRes, data) {
    override fun convert(helper: BaseViewHolder?, item: Pair<String, String>?) {
        helper?.let {
            Glide.with(mContext).load(item?.second).into(it.getView(R.id.iv_image))
            it.setText(R.id.tv_name, item?.first)
        }
    }
}